#include <bits/stdc++.h>
using namespace std;
using uint=unsigned int;
using ll=long long;
using ull=unsigned long long;
using i128=__int128;
const int N=1e6+5;

void solve(){
    
    return;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    string s;
    cin>>s;
    int t=s.length();
    map<char,int> mp;
    for(int i=0;i<t;i++){
        mp[s[i]]++;
    }
    for(int i=0;i<t;i++){
        if(mp[s[i]]!=2){
            cout<<"No"<<endl;
            return 0;
        }
    }
    if(t%2!=0){
        cout<<"No"<<endl;
        return 0;
    }
    int k=t/2;
    for(int i=1;i<=k;i++){
        if(s[2*i-2]!=s[2*i-1]){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;

    return 0;
}